<template>

  <div class="app-wrapper">
    <div class="navbar">
      <div class="main-title" @click="backToDash">双凤镇企业用地租赁分级管理平台</div>
    </div>
    <div class="map-sidebar">
      <el-scrollbar wrap-class="scrollbar-wrapper">
        <div class="company-list-wrapper">

          <div class="head-container">
            <eHeader :permission="permission"/>
          </div>
          <!--表格渲染-->

          <div>
            <div class="company-panel" v-for="item in crud.data">
              <div class="img-wrapper">

                <img class="cover-img" v-if="item.photoFileList.length" :src="item.photoFileList[0].filePath" alt="">
              </div>
              <div class="info-wrapper">
                <p class="title fz-20 text-dark">{{ item.enterpriseName }}</p>
                <p class="fz-16 text-gray">地址：{{item.officeAddress}}</p>
                <p class="fz-16 text-gray">联系电话：{{item.contactPhone}}</p>
              </div>
            </div>
          </div>
          <!--分页组件-->
          <pagination/>
        </div>


      </el-scrollbar>
    </div>
    <div class="map-main-container">
      <amap />

    </div>

  </div>

</template>

<script>
import {mapGetters} from 'vuex'
import eHeader from './header'
import CRUD, {presenter} from '@crud/crud'
import pagination from '@crud/Pagination'
import crudLandlord from "@/api/business/demand";
import Amap from './map.vue'

export default {
  name: 'Map',
  components: {
    eHeader, pagination,Amap
  },
  cruds() {
    return CRUD({
      title: '厂房信息汇总',
      url: 'business/demand/list',
      crudMethod: {...crudLandlord},
      addPage: true,
      // addPageUrl: addPageUrl,
      editPage: true,
      // editPageUrl: editPageUrl,
      // editParams: ['id'],
      optShow: {
        add: false,
        edit: false,
        del: true,
        reset: true
      },
      query: {}

    })
  },
  mixins: [presenter()],
  // 数据字典

  data() {
    return {
      permission: {
        add: [],
        edit: [],
        del: [],
        info: []
      },
      landlordId: null,
    }
  },
  methods: {
    backToDash() {
      this.$router.push('/dashboard')
    }
  }
}
</script>

<style lang="scss" scoped>
.main-title {
  font-size: 18px;
  line-height: 80px;
  margin-left: 100px;
  cursor: pointer;
}

.navbar {
  height: 80px;
  background: #FFFFFF;
  box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.5);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 2;
}

@import "~@/styles/mixin.scss";
@import "~@/styles/variables.scss";

.app-wrapper {
  @include clearfix;
  position: relative;
  height: 100%;
  width: 100%;
}

.map-sidebar {
  transition: width 0.28s;
  width: 600px !important;
  background: #FFFFFF;
  box-shadow: 2px 10px 4px 0px rgba(193, 193, 193, 0.5);
  height: 100%;
  position: fixed;
  font-size: 0;
  top: 0;
  bottom: 0;
  left: 0;
  overflow: hidden;
  z-index:1;

  ::v-deep.scrollbar-wrapper {
    overflow-x: hidden !important;
  }

  .el-scrollbar__bar.is-vertical {
    right: 0;
  }

  .el-scrollbar {
    height: 100%;
  }
}

.company-list-wrapper {
  padding: 20px;
  padding-top: 100px;
  height: 100%;
  width: 100% !important;
  font-size: 14px;
}

.map-main-container {
  min-height: 100vh;
  padding-top:80px;
  transition: margin-left 0.28s;
  margin-left: 600px;
  position: relative;
}

.cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.company-panel {
  display: flex;
  margin-bottom:20px;
  padding-bottom:20px;
  border-bottom: 1px solid #DDDDDD;
  .title{
    margin-top:0;
  }

  .img-wrapper {
    width: 200px;
    height: 120px;


  }
  .info-wrapper{
    padding:20px;
    padding-top:0;
    flex:1;
  }
}
.fz-16{
  font-size: 16px;
}
.fz-20{
  font-size: 20px;
}
.text-dark{
  color: #333333;

}
.text-gray{
  color: #999999;

}
</style>
